<!DOCTYPE html>
<html style="width:100%;">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>端API</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>
</head>
<body style="width:100%;">
<div id="app" class="mall-body" v-cloak>
    <div class="mall-right" style="width:100%;width:100%;overflow-x:hidden;overflow-y:hidden">
        <div>
            <div class="module-div">
                <div class="module-repeat" if="categorysBy1.length>0">
                    <!-- <div class="list-one-top">
                        <hr/>
                        <span>{{categorysBy1.pname}}</span>
                    </div> -->
                    <div class="list-one-body">
                        <div class="repeat-image" v-for="(tKey ,index) in categorysBy1" :key="tKey.category_id"
                             v-myclick="[[tKey.category_id, tKey.name,tKey.keyword], searchGoods]">
                            <img v-image-resize="{src:tKey.icon}" width="90%" />
                            <span style="color:#999999">{{tKey.name}}</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="../../script/vue.js"></script>
<script src="../../script/api.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script>
    var categorysBy1;
    var vm;
    apiready = function () {

        setBSImg();
        categorysBy1 = '';
        initApp();
        api.parseTapmode();
        addListeners();
    };

    function initApp() {
        vm = new Vue({
            el: '#app',
            data: {
                categorysBy1: categorysBy1
            },
            methods: {
                searchGoods: function (id, name,keyword) {
                    var params = {
                        "category_id": id,
                        "cate_name": name,
                        "keyword":keyword
                    };
                    var otherAttr = {
                        vScrollBarEnabled: false
                    };
                    openWin('search_list', params, otherAttr);
                },
            },
        })
    }

    function addListeners() {
        api.addEventListener({
            name: 'getCategorysBy1'
        }, function (ret) {
            vm.categorysBy1 = ret.value.categorysBy1;
        });
    }


</script>
</html>
